|
|
@@ -226,19 +226,19 @@ class Agent < ActiveRecord::Base
|
226
|
226
|
private
|
227
|
227
|
|
228
|
228
|
def sources_are_owned
|
229
|
|
- errors.add(:sources, "must be owned by you") unless sources.all? {|s| s.user == user }
|
|
229
|
+ errors.add(:sources, "must be owned by you") unless sources.all? {|s| s.user_id == user_id }
|
230
|
230
|
end
|
231
|
231
|
|
232
|
232
|
def controllers_are_owned
|
233
|
|
- errors.add(:controllers, "must be owned by you") unless controllers.all? {|s| s.user == user }
|
|
233
|
+ errors.add(:controllers, "must be owned by you") unless controllers.all? {|s| s.user_id == user_id }
|
234
|
234
|
end
|
235
|
235
|
|
236
|
236
|
def control_targets_are_owned
|
237
|
|
- errors.add(:control_targets, "must be owned by you") unless control_targets.all? {|s| s.user == user }
|
|
237
|
+ errors.add(:control_targets, "must be owned by you") unless control_targets.all? {|s| s.user_id == user_id }
|
238
|
238
|
end
|
239
|
239
|
|
240
|
240
|
def scenarios_are_owned
|
241
|
|
- errors.add(:scenarios, "must be owned by you") unless scenarios.all? {|s| s.user == user }
|
|
241
|
+ errors.add(:scenarios, "must be owned by you") unless scenarios.all? {|s| s.user_id == user_id }
|
242
|
242
|
end
|
243
|
243
|
|
244
|
244
|
def validate_schedule
|